const exprress = require('express')
const router = exprress.Router()
const joi = require('@escook/express-joi')
const handler = require('../RouterHandler/user')
const {
	user,update,resetPwd,avatar
} = require('./rule')

//登录
router.post('/common/login', joi(user), handler.login)
//注册
router.post('/common/logon', joi(user), handler.logon)
router.delete('/common/logOff', handler.logOff)
//获取用户信息
router.get('/user/userInfo', handler.getUserInfo)

router.get('/user/getUsersList', handler.getUsersList)
//判断是否设置支付密码
router.get('/user/checkUserPaymentPwd', handler.checkUserPaymentPwd)
//判断支付金额是否输入错误
router.post('/user/checkUserPaymentPwdInput', handler.checkUserPaymentPwdInput)
router.post('/user/rechargeMoney', handler.rechargeMoney)
//根据id更新用户信息
router.post('/user/updataUserInfo',  handler.updataUserInfo)
//重置密码
router.post('/common/resetPassword',joi(resetPwd),handler.resetPassword)
//上传头像
router.post('/user/updateHeadImg',joi(avatar),handler.updateHeadImg)
//获取用户列表
router.post('/user/getUserList', handler.getUserList)
//获取微博、关注、粉丝 数量
router.post('/user/getUserDetial', handler.getUserDetial)
module.exports = router
